package org.tigris.subversion.svnant.conditions;

import java.io.File;
import java.net.MalformedURLException;
import org.apache.tools.ant.Project;
import org.tigris.subversion.svnant.SvnFacade;
import org.tigris.subversion.svnclientadapter.ISVNClientAdapter;
import org.tigris.subversion.svnclientadapter.ISVNInfo;
import org.tigris.subversion.svnclientadapter.SVNClientException;
import org.tigris.subversion.svnclientadapter.SVNRevision;
import org.tigris.subversion.svnclientadapter.SVNRevision.Number;
import org.tigris.subversion.svnclientadapter.SVNUrl;

public class Exists extends SvnCondition
{
  private String target = null;

  public boolean internalEval()
  {
    ISVNClientAdapter localISVNClientAdapter = SvnFacade.getClientAdapter(this);
    ISVNInfo localISVNInfo = null;
    try
    {
      File localFile = new File(Project.translatePath(this.target));
      if (localFile.exists())
        localISVNInfo = localISVNClientAdapter.getInfo(localFile);
      else
        try
        {
          SVNUrl localSVNUrl = new SVNUrl(this.target);
          localISVNInfo = localISVNClientAdapter.getInfo(localSVNUrl);
        }
        catch (MalformedURLException localMalformedURLException)
        {
          localISVNInfo = localISVNClientAdapter.getInfo(localFile);
        }
    }
    catch (SVNClientException localSVNClientException)
    {
      return false;
    }
    if (null == localISVNInfo)
      return false;
    return (localISVNInfo.getRevision() != null) && (!SVNRevision.INVALID_REVISION.equals(localISVNInfo.getRevision()));
  }

  public String getTarget()
  {
    return this.target;
  }

  public void setTarget(String paramString)
  {
    this.target = paramString;
  }
}

/* Location:           C:\Users\Administrator\Desktop\svnant.jar
 * Qualified Name:     org.tigris.subversion.svnant.conditions.Exists
 * JD-Core Version:    0.6.0
 */